<?php


    //前端页面
    Route::get('/', 'Home\\IndexController@index');
    Route::get('/post/{id}', 'Home\\IndexController@post');//与administrator 冲突了
    Route::get('/posts', 'Home\\IndexController@posts');
    Route::get('/invest','Home\\InvestController@index');
    Route::get('/search/{keyword}','Home\\IndexController@search');
    Route::get('/m/index/ad','M\\IndexController@ad');
    Route::get('/edit','Home\\IndexController@edit');//测试编辑的页面
    Route::get('/content','Home\\IndexController@content');//被编辑的页面




    //后台管理
    Route::group(['middleware'=>'admin.auth'],function(){
        Route::get('/admin', 'Admin\\AdministratorController@index');
        //文章管理
        Route::get('/admin/post', 'Admin\\PostController@index');
        Route::post('/admin/post', 'Admin\\PostController@store');
        Route::get('/admin/post/create', 'Admin\\PostController@create');
        Route::get('/admin/post/{id}/edit', 'Admin\\PostController@edit');
        Route::post('/admin/post/{id}', 'Admin\\PostController@update');
        Route::get('/admin/post/{id}/delete','Admin\\PostController@delete');

        //文章分类管理
        Route::get('/admin/postCid', 'Admin\\PostCidController@index');
        Route::post('/admin/postCid', 'Admin\\PostCidController@store');
        Route::get('/admin/postCid/create', 'Admin\\PostCidController@create');
        Route::get('/admin/postCid/{id}/edit', 'Admin\\PostCidController@edit');
        Route::post('/admin/postCid/{id}', 'Admin\\PostCidController@update');
        Route::get('/admin/postCid/{id}/delete','Admin\\PostCidController@delete');

        //菜单管理
        Route::get('/admin/menu', 'Admin\\MenuController@index');
        Route::post('/admin/menu', 'Admin\\MenuController@store');
        Route::get('/admin/menu/create', 'Admin\\MenuController@create');
        Route::get('/admin/menu/{id}/edit', 'Admin\\MenuController@edit');
        Route::post('/admin/menu/{id}', 'Admin\\MenuController@update');
        Route::get('/admin/menu/{id}/delete','Admin\\MenuController@delete');

        //配置管理
        Route::get('/admin/config', 'Admin\\ConfigController@index');
        Route::post('/admin/config', 'Admin\\ConfigController@store');
        Route::get('/admin/config/create', 'Admin\\ConfigController@create');
        Route::get('/admin/config/{id}/edit', 'Admin\\ConfigController@edit');
        Route::post('/admin/config/{id}', 'Admin\\ConfigController@update');
        Route::get('/admin/config/{id}/delete','Admin\\ConfigController@delete');

        //轮播管理
        Route::get('/admin/banner', 'Admin\\BannerController@index');
        Route::post('/admin/banner', 'Admin\\BannerController@store');
        Route::get('/admin/banner/create', 'Admin\\BannerController@create');
        Route::get('/admin/banner/{id}/edit', 'Admin\\BannerController@edit');
        Route::post('/admin/banner/{id}', 'Admin\\BannerController@update');
        Route::get('/admin/banner/{id}/delete','Admin\\BannerController@delete');

        //广告管理
        Route::get('/admin/ad', 'Admin\\AdController@index');
        Route::post('/admin/ad', 'Admin\\AdController@store');
        Route::get('/admin/ad/create', 'Admin\\AdController@create');
        Route::get('/admin/ad/{id}/edit', 'Admin\\AdController@edit');
        Route::post('/admin/ad/{id}', 'Admin\\AdController@update');
        Route::get('/admin/ad/{id}/delete','Admin\\AdController@delete');

        //推荐位置管理
        Route::get('/admin/recommend', 'Admin\\RecommendController@index');
        Route::post('/admin/recommend', 'Admin\\RecommendController@store');
        Route::get('/admin/recommend/create', 'Admin\\RecommendController@create');
        Route::get('/admin/recommend/{id}/edit', 'Admin\\RecommendController@edit');
        Route::post('/admin/recommend/{id}', 'Admin\\RecommendController@update');
        Route::get('/admin/recommend/{id}/delete','Admin\\RecommendController@delete');
        Route::get('/admin/recommend/{id}/append','Admin\\RecommendController@append');//添加推荐位
        Route::get('/admin/recommend/{recid}/appendAction/{postid}','Admin\\RecommendController@appendAction');
        Route::get('/admin/recommend/{id}/showAppend','Admin\\RecommendController@showAppend');//查看
        Route::get('/admin/recommend/{recid}/cancelAppend/{postid}','Admin\\RecommendController@cancelAppend');

        //友情连接  品牌推荐  自媒体平台
        Route::get('/admin/friend/type/{type}', 'Admin\\FriendController@index');
        Route::post('/admin/friend', 'Admin\\FriendController@store');
        Route::get('/admin/friend/create/type/{type}', 'Admin\\FriendController@create');
        Route::get('/admin/friend/{id}/edit', 'Admin\\FriendController@edit');
        Route::post('/admin/friend/{id}', 'Admin\\FriendController@update');
        Route::get('/admin/friend/{id}/delete','Admin\\FriendController@delete');

        //标签管理
        Route::get('/admin/tag', 'Admin\\TagController@index');
        Route::post('/admin/tag', 'Admin\\TagController@store');
        Route::get('/admin/tag/create', 'Admin\\TagController@create');
        Route::get('/admin/tag/{id}/edit', 'Admin\\TagController@edit');
        Route::post('/admin/tag/{id}', 'Admin\\TagController@update');
        Route::get('/admin/tag/{id}/delete','Admin\\TagController@delete');

        //图片上传
        Route::any("/admin/upload","Admin\\UploadController@upload");
        Route::any("/admin/editorUpload","Admin\\UploadController@editorUpload");

    });
    Route::any('/admin/signIn', 'Admin\\AdministratorController@signIn');
    Route::get('/admin/signOut', 'Admin\\AdministratorController@signOut');







//需要跳转微信的页面
Route::group(['middleware' => 'wechat.oauth'], function () {


});


//微信
Route::any('/callbacks/wechat', 'CallbackController@listenToWechat');
Route::any('/callbacks/payments/yunpay/notify', 'CallbackController@listenToYunpay');
Route::any('/callbacks/payments/yunpay/return', 'CallbackController@listenToYunpayReturn');

Route::get('/test', 'TestController@run');
